package com.bw.shopping.adapter;

import android.widget.ImageView;

import com.bw.greendao.entity.ShoppEntity;
import com.bw.mvvm_common.network.load.LoadImage;
import com.bw.shopping.R;
import com.bw.shopping.entity.ShoppingEnttiy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import org.jetbrains.annotations.NotNull;

/**
 * @author KK
 * @description:
 * @date :2021/10/26 10:12
 */
public class OfflineAdapter extends BaseQuickAdapter<ShoppEntity, BaseViewHolder> {
    public OfflineAdapter() {
        super(R.layout.item_shopping);
    }


    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, ShoppEntity shoppEntity) {
        ImageView im = baseViewHolder.findView(R.id.item_shopping_im);
        baseViewHolder.setText(R.id.item_shopping_title,shoppEntity.getGoods_default_sku());
        baseViewHolder.setText(R.id.item_shopping_tv,shoppEntity.getGoods_desc());
        baseViewHolder.setText(R.id.item_shopping_money,"￥"+shoppEntity.getGoods_price());
        LoadImage.loadMatchImg(shoppEntity.getGoods_default_icon(),im);
    }
}
